

from mycelery.main import app
# from luffyapi.settings import contants
import logging
logger = logging.getLogger('django')
@app.task
def send_email(password,email):
    """ 发送短信任务 """
    #   PBBWRSMNZMIDMQBL

    from django.core.mail import send_mass_mail
    message1 = ('您的密码已经重置', '您的密码为 %s 请妥善保管' % password, '18800140015@163.com', ['707818899@qq.com', ])
    # send_mail的参数分别是  邮件标题，邮件内容，发件箱(settings.py中设置过的那个)，收件箱列表(可以发送给多个人),失败静默(若发送失败，报错提示我们)
    ret = send_mass_mail((message1, ), fail_silently=False)
    if not ret:
        logger.error("%s 发送邮件失败" % email )



